<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>邮件发送历史</title>
    <style>
        body { font-family: Arial, sans-serif; margin: 20px; }
        table { width: 100%; border-collapse: collapse; }
        th, td { border: 1px solid #ddd; padding: 8px; text-align: left; }
        th { background-color: #f2f2f2; }
        .status-success { color: green; }
        .status-failed { color: red; }
    </style>
</head>
<body>
<h2>邮件发送历史</h2>
<table>
    <thead>
    <tr>
        <th>收件人ID</th>
        <th>收件人邮箱</th>
        <th>主题</th>
        <th>状态</th>
        <th>发送时间</th>
        <th>错误信息</th>
    </tr>
    </thead>
    <tbody>
    <tr th:each="log : ${emailLogs}">
        <td th:text="${log.recipientId}"></td>
        <td th:text="${log.recipientEmail}"></td>
        <td th:text="${log.subject}"></td>
        <td th:class="${log.status == 'SUCCESS'} ? 'status-success' : 'status-failed'" th:text="${log.status}"></td>
        <td th:text="${#temporals.format(log.createTime, 'yyyy-MM-dd HH:mm:ss')}"></td>
        <td th:text="${log.errorMessage}"></td>
    </tr>
    </tbody>
</table>
</body>
</html>